package com.springcloud.config.feign;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import com.springcloud.annotation.ExcludComponentScanClass;

import feign.Contract;
import feign.Feign;

/**
 * 定制User2专用配置
 * 
 * @author Pakho
 *
 */
@Configuration
@ExcludComponentScanClass
public class User2FeignConfig {

	@Bean // 契约，feign默认使用springmvc注解，修改成Default后只能使用feign注解
	public Contract feignContract() {
		return new feign.Contract.Default();
	}

	// 禁用单个feignclient 对feign支持
	@Bean
	@Scope("prototype")
	public Feign.Builder feignBuilder() {
		// 默认HystrixFeign.Builder
		return Feign.builder();
	}
}
